<?php
namespace Admin\Controller;

use Think\Controller;
class AdminController extends Controller
{
    public function admin()
    {   
        $page = I('get.page',1);
    	$pre_page = I('get.pre_page',10);
        $b = M('admin');
        $w = array();
        if (!empty($_GET['st'])) {
            $w['st'] =$_GET['st'];
        }
        $count = $b->where($w)->count();
        $Page = new \Think\Page($count,$pre_page);
        $show = $Page->show();
        $users = $b->where($w)->limit($Page->firstRow.','.$Page->listRows)->select();
        // print_r($users['id']);die;
        $this->assign('users', $users);
        $this->assign('page', $show);
        $this->display();
    }
}